package play.go.rule;

public abstract class Point {
    
    public int color;
    public int x;
    public int y;
    
    public Point() {
        this(0, 0, 0);
    }
    
    public Point(int color, int x, int y) {
        this.color = color;
        this.x = x;
        this.y = y;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#hashCode()
     */
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + color;
        result = prime * result + x;
        result = prime * result + y;
        return result;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#equals(java.lang.Object)
     */
    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null) return false;
        if (getClass() != obj.getClass()) return false;
        Point other = (Point) obj;
        if (color != other.color) return false;
        if (x != other.x) return false;
        if (y != other.y) return false;
        return true;
    }
    
}
